<?php
/**
* Quản lý cấu hình
*/
class Admin_ConfigController extends Zend_Controller_Action{
		
	function init(){
		$this->Params = $this->getRequest()->getParams();
		System_Template::using('blank','Admin');
        parent::init();
	}
	function indexAction(){
        
	}
	function saveconfigttchungAction(){
        $arr1 = array(
            'name' => $this->Params['infoname'],
            'address' => $this->Params['infoaddress'],
			'pageTitle' => $this->Params['infopageTitle']
        );  
		$arr2 = array(
			'limit' => $this->Params['pageLimit'],
			'offset' => $this->Params['pageOffset']
        );
        config::set('config.ini','info',$arr1);
		config::set('config.ini','page',$arr2);
        ajax::ship('result','1');
	}

	function saveconfigemailAction(){
        $arr = array(
            'ssl' => $this->Params['ssl'],
            'port' => $this->Params['port'],
            'auth' => $this->Params['auth'],
			'username' => $this->Params['username'],
			'password' => $this->Params['password'],
			'host' => $this->Params['host'],
			'lang' => $this->Params['lang'],
        	'from' => $this->Params['from'],
        	'aliasfrom' => $this->Params['alias'],
        	'title' => $this->Params['title'],
        	'dirupload' => $this->Params['dirupload'],
        );        
        config::set('config.ini','email',$arr);
        ajax::ship('result','1');
	}
	function saveconfigcontactAction(){
        $arr = array(
            'nameshop' => $this->Params['nameshop'],
            'address' => $this->Params['address'],
            'city' => $this->Params['city'],
			'phone' => $this->Params['phone'],
			'email' => $this->Params['email'],
			'card' => $this->Params['card']
        );        
        config::set('config.ini','contact',$arr);
        ajax::ship('result','1');
	}
	function saveconfigsupportAction(){
	        $arr = array(
	            'yahoo1' => $this->Params['yahoo1'],
	            'yahoo2' => $this->Params['yahoo2'],
	            'yahoo3' => $this->Params['yahoo3'],
				'yahoo4' => $this->Params['yahoo4'],
		        'titleyahoo1' => $this->Params['titleyahoo1'],
		        'titleyahoo2' => $this->Params['titleyahoo2'],
		        'titleyahoo3' => $this->Params['titleyahoo3'],
		        'titleyahoo4' => $this->Params['titleyahoo4'],
	        );        
	        config::set('config.ini','support',$arr);
	        ajax::ship('result','1');
	}
	function openingnoteAction(){
			$arr = array(
	            'titleopening' => $this->Params['TITLEOPENING'],
	        );        
	        config::set('config.ini','note',$arr);
	        ajax::ship('result','1');
	}
	
	
}	
	
		
		  	
	
